<template>
    <el-button type="success" @click="addFolder">新建文件夹</el-button>
</template>

<script setup lang="ts">
import { fileStore} from '@/stores/disk/file'
const store= fileStore();
/**
 * 新建文件夹
 */
 function addFolder(){
  //判断是否在根目录
  if(store.state.currentClickFile===null){
      //是根路径
      const newFolder={
        fileName:'',
        fileType: 3,
        parentId: null,
        isNew:true
      }
      store.addFileList(newFolder)
  }else{
      //不是根路径
      const parentId=store.state.currentClickFile.id
      const newFolder={
        fileName:'',
        fileType: 3,
        parentId:parentId,
        isNew:true
      }
      store.addFileList(newFolder)
  }
   
}

</script>

<style scoped>

</style>